package file;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-10-29
 * Time: 19:32
 */

//按照字节流来写文件
public class Demo3 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("e:/text.txt")){
            //输的数字 实际写的字符
            outputStream.write(97);
            outputStream.write(98);
            outputStream.write(99);
            //一次输入多个字符 写的都是数字 文本里是abc
            byte[] buffer = new byte[]{97,98,99,100};
            outputStream.write(buffer);


        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
